<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="bookings.title"/></title>
    <meta name="heading" content="<fmt:message key='bookings.heading'/>"/>
    <meta name="menu" content="BookingsMenu"/>
</head>

<p><fmt:message key="bookings.message"/></p>

${param.xss}

<div class="separator"></div>

<p/>

<s:form action="updateBookings">
<s:if test="eventBookingStatusList.size>0">
<div>
	<table class="table">
		<tr><th><h3>Event</h3></th><th><h3>Booked</h3></th></tr>
		<!--<tr><th>Event</th><th>Booked</th></tr>
		--><s:iterator value="eventBookingStatusList" status="stat" var="eventBookingStatusDto">
			<tr>
			  	<td><s:textfield name="eventBookingStatusList[%{#stat.index}].eventName" value="%{#eventBookingStatusDto.eventName}" readonly="true" theme="simple"/></td>
			  	<td><s:checkbox name="eventBookingStatusList[%{#stat.index}].booked" value="%{#eventBookingStatusDto.booked}" theme="simple" id="chkbx"/></td>
		  	</tr>
		  	<s:hidden name="eventBookingStatusList[%{#stat.index}].eventId" value="%{#eventBookingStatusDto.eventId}" theme="simple"/>
		</s:iterator>
	</table>
</div>
<div>
	<s:submit key="button.save" method="updateBookingsForUser" theme="simple"/>
	<s:submit key="button.cancel" method="cancel" theme="simple"/>
</div>
<!--
This table display-only. But could use links and AJAX for updating (e.g., checking/unchecking checkbox). Might be better to use JQuery
-->
<!--<display:table name="eventBookingStatusList" cellspacing="0" cellpadding="0" requestURI="" 
    defaultsort="1" id="eventBookingStatusList" pagesize="25" class="table" export="true">
    <display:column property="eventName" escapeXml="true" sortable="true" titleKey="user.username" style="width: 25%"/>
    <display:column sortProperty="booked" sortable="true" titleKey="user.enabled" style="width: 16%; padding-left: 15px" media="html">
        <input type="checkbox"  <c:if test="${eventBookingStatusList.booked}">checked="checked"</c:if>/>
    </display:column>
    <display:setProperty name="paging.banner.item_name" value="event"/>
    <display:setProperty name="paging.banner.items_name" value="events"/>

    <display:setProperty name="export.excel.filename" value="User List.xls"/>
    <display:setProperty name="export.csv.filename" value="User List.csv"/>
    <display:setProperty name="export.pdf.filename" value="User List.pdf"/>
</display:table>

--></s:if>
<s:else><p><fmt:message key="bookings.no.events.defined"/></p></s:else>

</s:form>
